<!DOCTYPE html>
<html lang="" xml:lang="">
  <head>
    <title>使用 BP 程序进行特定的光合测量的演示</title>
    <meta charset="utf-8" />
    <meta name="author" content="祝介东" />
    <link rel="stylesheet" href="zh-CN.css" type="text/css" />
    <link rel="stylesheet" href="extra-rutgers.css" type="text/css" />
    <link rel="stylesheet" href="animate-min.css" type="text/css" />
  </head>
  <body>
    <textarea id="source">
class: center, middle, inverse, title-slide

# 使用 BP 程序进行特定的光合测量的演示
## 模拟多云条件下的可变光测量
### 祝介东
### 北京力高泰科技有限公司 技术部
### 2020-04-26 修改

---

background-image: url(https://s2.ax1x.com/2020/03/09/8S2l7T.png)

background-size: cover

class: center, middle, animated, fadeIn

# .large[模拟多云条件下的可变光测量]
---
class: animated, fadeIn

# 示例5：模拟多云天气的可变光的测量

&lt;img src="./img/cloud.png" width="832" /&gt;

我们以上面这篇文献所实施的测量方式为例，模拟多云（可变光）下光合的测量。
- 控制稳定的 VPD 和叶温
- 设定 400 ppm 的 `\(CO_2\)` 和 1200 的光强对叶片进行诱导
- 设置低光 50 持续 30 mins，高光 1200 持续 10 mins 的变化
- 变化分别在 `\(CO_2\)` 为 50， 100， 200， 300， 400， 500， 600， 800， 1000 下进行

---
class: animated, fadeIn
# 推荐方法：

- 定义一个 subroutine，用于自动计数和控制光强和 `\(CO_2\)` 浓度。

- 使用 Call 反复调用，来修改浓度和光强的变化

- 在开始变化之前的诱导时，利用 WAIT 等待稳定，然后匹配

- 整个测量过程中控温，因为 range match 的存在，无需匹配
---
# 关键的 STEP
```python
WAIT(min="60",max="60*15",early="False"),
CALL("var_cr_qin", ['50', '50', '30', '10']),
CALL("var_cr_qin", ['50', '500', '15', '10']),
CALL("var_cr_qin", ['100', '50', '30', '10']),
CALL("var_cr_qin", ['100', '500', '15', '10']),
DEFINE("var_cr_qin",
	[['cr', 'Value'], ['qin', 'Value'], ['duration', 'Value'], ['intv', 'Value']],
	steps=(''])
		SETCONTROL("Qin","qin","float"),
		SETCONTROL("CO2_r","cr","float"),
		LOOP(dur="duration",
			units="Minutes",
			steps=()
				WAIT(dur="intv",units="Seconds"),
				LOG(),
			)
		),
	)
)
```
---
class: animated, fadeIn

# 关键 STEPs 解释

### - DEFINE 是定义一个 subroutine，实际上是一个函数，我们此处定义了控光、控二氧化碳、控测量间隔和时长 4 个参数。注意，DEFINE 的位置不影响程序

### - CALL 是调用函数，分别输入不同的上述 4 个参数，做对应的控制测量

### - WAIT 除了等待时间外，还可以用于等待分析器读数稳定
---
class: animated, fadeIn, center, middle, inverse

# .large[示例5的演示]
---
class: inverse, center, middle, animated, fadeIn

# .large[谢谢！]

![](./img/gif-qrcode.gif)&lt;!-- --&gt;
## 关注公众号后获取更多精彩内容
    </textarea>
<style data-target="print-only">@media screen {.remark-slide-container{display:block;}.remark-slide-scaler{box-shadow:none;}}</style>
<script src="https://remarkjs.com/downloads/remark-latest.min.js"></script>
<script>var slideshow = remark.create({
"ratio": "16:9",
"highlightStyle": "ir-black",
"highlightLines": true,
"countIncrementalSlides": false
});
if (window.HTMLWidgets) slideshow.on('afterShowSlide', function (slide) {
  window.dispatchEvent(new Event('resize'));
});
(function(d) {
  var s = d.createElement("style"), r = d.querySelector(".remark-slide-scaler");
  if (!r) return;
  s.type = "text/css"; s.innerHTML = "@page {size: " + r.style.width + " " + r.style.height +"; }";
  d.head.appendChild(s);
})(document);

(function(d) {
  var el = d.getElementsByClassName("remark-slides-area");
  if (!el) return;
  var slide, slides = slideshow.getSlides(), els = el[0].children;
  for (var i = 1; i < slides.length; i++) {
    slide = slides[i];
    if (slide.properties.continued === "true" || slide.properties.count === "false") {
      els[i - 1].className += ' has-continuation';
    }
  }
  var s = d.createElement("style");
  s.type = "text/css"; s.innerHTML = "@media print { .has-continuation { display: none; } }";
  d.head.appendChild(s);
})(document);
// delete the temporary CSS (for displaying all slides initially) when the user
// starts to view slides
(function() {
  var deleted = false;
  slideshow.on('beforeShowSlide', function(slide) {
    if (deleted) return;
    var sheets = document.styleSheets, node;
    for (var i = 0; i < sheets.length; i++) {
      node = sheets[i].ownerNode;
      if (node.dataset["target"] !== "print-only") continue;
      node.parentNode.removeChild(node);
    }
    deleted = true;
  });
})();
(function() {
  "use strict"
  // Replace <script> tags in slides area to make them executable
  var scripts = document.querySelectorAll(
    '.remark-slides-area .remark-slide-container script'
  );
  if (!scripts.length) return;
  for (var i = 0; i < scripts.length; i++) {
    var s = document.createElement('script');
    var code = document.createTextNode(scripts[i].textContent);
    s.appendChild(code);
    var scriptAttrs = scripts[i].attributes;
    for (var j = 0; j < scriptAttrs.length; j++) {
      s.setAttribute(scriptAttrs[j].name, scriptAttrs[j].value);
    }
    scripts[i].parentElement.replaceChild(s, scripts[i]);
  }
})();
(function() {
  var links = document.getElementsByTagName('a');
  for (var i = 0; i < links.length; i++) {
    if (/^(https?:)?\/\//.test(links[i].getAttribute('href'))) {
      links[i].target = '_blank';
    }
  }
})();
// adds .remark-code-has-line-highlighted class to <pre> parent elements
// of code chunks containing highlighted lines with class .remark-code-line-highlighted
(function(d) {
  const hlines = d.querySelectorAll('.remark-code-line-highlighted');
  const preParents = [];
  const findPreParent = function(line, p = 0) {
    if (p > 1) return null; // traverse up no further than grandparent
    const el = line.parentElement;
    return el.tagName === "PRE" ? el : findPreParent(el, ++p);
  };

  for (let line of hlines) {
    let pre = findPreParent(line);
    if (pre && !preParents.includes(pre)) preParents.push(pre);
  }
  preParents.forEach(p => p.classList.add("remark-code-has-line-highlighted"));
})(document);</script>

<script>
slideshow._releaseMath = function(el) {
  var i, text, code, codes = el.getElementsByTagName('code');
  for (i = 0; i < codes.length;) {
    code = codes[i];
    if (code.parentNode.tagName !== 'PRE' && code.childElementCount === 0) {
      text = code.textContent;
      if (/^\\\((.|\s)+\\\)$/.test(text) || /^\\\[(.|\s)+\\\]$/.test(text) ||
          /^\$\$(.|\s)+\$\$$/.test(text) ||
          /^\\begin\{([^}]+)\}(.|\s)+\\end\{[^}]+\}$/.test(text)) {
        code.outerHTML = code.innerHTML;  // remove <code></code>
        continue;
      }
    }
    i++;
  }
};
slideshow._releaseMath(document);
</script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
  var script = document.createElement('script');
  script.type = 'text/javascript';
  script.src  = 'https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML';
  if (location.protocol !== 'file:' && /^https?:/.test(script.src))
    script.src  = script.src.replace(/^https?:/, '');
  document.getElementsByTagName('head')[0].appendChild(script);
})();
</script>
  </body>
</html>
